//
//  SZLDrawTypeViewController.m
//  Shengzhuli
//
//  Created by 卡忙科技 on 16/8/25.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "SZLDrawTypeViewController.h"
#import "SZLWithDrawViewController.h"

@interface SZLDrawTypeViewController ()

@property (nonatomic,strong) NSArray *titles;

@end

@implementation SZLDrawTypeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"提现";
    self.titles = @[@"支付宝",@"银行卡"];
    self.tableView.backgroundColor = RGBColorOne(240);
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:NSStringFromClass([UITableViewCell class])];
    self.tableView.tableFooterView = [[UIView alloc]init];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.titles.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([UITableViewCell class]) forIndexPath:indexPath];
    cell.textLabel.text = self.titles[indexPath.row];
    cell.textLabel.font = Font(15);
    cell.textLabel.textColor = [UIColor grayColor];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    SZLWithDrawViewController *drawVc = [[SZLWithDrawViewController alloc]init];
    drawVc.type = (indexPath.row == 0)?DrawTypeAlipay:DrawTypeCard;
    drawVc.model = self.model;
    [self.navigationController pushViewController:drawVc animated:YES];
}

@end
